// 发布商品
// 发布商品
<template>
  <div>
    <div class="tobu">
      <a href=""> <span>发布商品</span> </a>
    </div>

    <!-- 基本信息 -->
    <div class="frame1">
      <div class="bianji">编辑基本性息</div>
      <div class="leixin">基本性息</div>
      <div class="sr clear">
        商品名：&nbsp; &nbsp;<input
          type=""
          placeholder="请输入内容"
          class="shuru"
        />
      </div>
      <!-- 上传图片 -->
      <div class="tp">
        <span>商品图：&nbsp; &nbsp; </span>

        <el-upload
          action="https://jsonplaceholder.typicode.com/posts/"
          list-type="picture-card"
          :on-preview="handlePictureCardPreview"
          :on-remove="handleRemove"
        >
          <i class="el-icon-plus"></i>
        </el-upload>
        <el-dialog :visible.sync="dialogVisible">
          <img width="100%" :src="dialogImageUrl" alt="" />
        </el-dialog>
        <i class="zhushi"
          >建议尺寸,800*800像素,你可以拖拽图片调整顺序,最多上传15张</i
        >
      </div>
      <div class="sr clear">
        商品分组：&nbsp; &nbsp;<input
          type=""
          placeholder="请输入内容"
          class="shuru"
        />
      </div>
      <div class="sr clear">
        商品描述：&nbsp; &nbsp;<input
          type=""
          placeholder="请输入内容"
          class="shuru"
        /><i class="zhushi2"
          >在商品详情页标题下面展示卖点信息,建议36个字以内 查看示例</i
        >
      </div>
      <div class="leixin">价格库存</div>

      <!-- 库存 -->
      <div>
        <div class="jiage">
          价格：&nbsp; &nbsp;&nbsp; &nbsp;<input
            type=""
            placeholder="￥"
            class="shuru2"
          />
        </div>
        <div class="jiage">
          库存：&nbsp; &nbsp;&nbsp; &nbsp;<input
            type=""
            placeholder=""
            class="shuru2"
          />&nbsp; &nbsp;
          <el-switch
            v-model="value1"
            active-text="显示剩余件数"
            inactive-text="不显示剩余件数"
          >
          </el-switch>
        </div>
        <div class="jiage">
          商品编码：&nbsp; &nbsp;<input type="" placeholder="" class="shuru2" />
        </div>
      </div>
      <div>
        <div class="leixin">其他信息</div>
        <div class="yunfei">
          快递运费：&nbsp; &nbsp; <input type="radio" />统一邮费
          <input type="" placeholder="" class="shuru2" />
        </div>
        <div class="yunfei">
          是否上架：<el-switch
            v-model="value2"
            active-text="下架"
            inactive-text="上架"
          ></el-switch>
        </div>
        <div class="yunfei">
          预售：&nbsp; &nbsp;
          <input type="radio" />无现货，下单后需要过段时间才能发货
        </div>
        <div class="yunfei">
          限购：&nbsp; &nbsp;
          <input type="radio" />无现货，下单后需要过段时间才能发货
        </div>
        <div class="box_181"></div>
      </div>
      <div class="dibu">
        <el-button>保存并查看</el-button> &nbsp; &nbsp;
        <el-button type="primary">下一步</el-button>
      </div>
    </div>
  </div>
</template> 
<style>
* {
  margin: 0;
  padding: 0;
}

.clear::before,
.clear::after {
  content: "";
  display: table;
}

.clear::after {
  clear: both;
}

.tobu {
  width: 1130px;
  height: 50px;
  background-color: rgba(255, 255, 255, 1);
  margin-left: 10px;
}
.tobu span {
  width: 96px;
  height: 50px;
  font-size: 14px;
  line-height: 50px;
  float: left;
  color: rgba(42, 130, 228, 1);
}
.el-main {
  padding: 0px;
}
.frame1 {
  width: 1130px;
  height: 1250px;
  left: 210px;
  top: 60px;
  color: rgba(80, 80, 80, 1);
  background-color: rgba(255, 255, 255, 1);
  font-size: 14px;
  line-height: 150%;
  border: rgba(229, 229, 229, 1) solid 1px;
  text-align: center;
  margin-top: 10px;
  margin-left: 10px;
  margin-bottom: 50px;
  /* margin: auto; */
}
/* 编辑 */
.bianji {
  width: 600px;
  height: 50px;
  left: 231px;
  top: 80px;
  color: rgba(255, 255, 255, 1);
  background-color: rgba(42, 130, 228, 1);
  font-size: 16px;
  line-height: 50px;
  text-align: center;
  margin-left: 240px;
  margin-top: 30px;
}
/* 类型 */
.leixin {
  width: 1050px;
  height: 44px;
  left: 231px;
  top: 148px;
  color: rgba(80, 80, 80, 1);
  background-color: rgba(243, 243, 243, 1);
  font-size: 15px;
  margin-left: 25px;
  padding-left: 25px;
  margin-top: 30px;

  text-align: left;
  font-weight: bold;
  line-height: 50px;
}
.shuru {
  width: 524px;
  height: 30px;
}
.sr {
  /* float: left; */
  text-align: left;
  margin-left: 100px;
  height: 60px;
}
/* 图片上传 */
.tp {
  /* float: left; */
  text-align: left;
  margin-bottom: 30px;
}
.tp span {
  float: left;
  font-size: 15px;
  margin-left: 100px;
}
.zhushi {
  width: 474px;
  height: 31px;
  left: 353px;
  top: 459px;
  color: rgba(166, 166, 166, 1);
  font-size: 12px;
  line-height: 150%;
  margin-left: 170px;
}
.zhushi2 {
  width: 474px;
  height: 31px;
  left: 353px;
  top: 459px;
  color: rgba(166, 166, 166, 1);
  font-size: 12px;
  line-height: 150%;
  float: left;
  margin-left: 80px;
}
.shuru2 {
  width: 200px;
  height: 30px;
}
.jiage {
  text-align: left;
  margin: 30px 30px 0 100px;
}
.yunfei {
  text-align: left;
  margin-left: 100px;
  margin-top: 30px;
}
.box_181 {
  width: 981px;
  height: 1px;
  left: 231px;
  top: 787px;
  color: rgba(80, 80, 80, 1);
  background-color: rgba(229, 229, 229, 1);
  font-size: 14px;
  line-height: 150%;
  text-align: center;
  margin-top: 60px;
  margin-left: 80px;
  margin-bottom: 30px;
}
</style>

<script>
// 上传图片
export default {
  data() {
    return {
      dialogImageUrl: "",
      dialogVisible: false,
      value1: true,
      value2: true,
    };
  },
  methods: {
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
  },
};
</script>